using System.Web.UI.WebControls;
using System.Web;

namespace App_Code
{
    static public class MyImage
    {
        // upload image with DetailsView
        public static void LoadHinh(DetailsView DetailsView1, string strFileUpload, string strImage, HttpServerUtility Server)
        {
            FileUpload fileUpload = DetailsView1.FindControl("FileUpload1") as FileUpload;
            Image image = DetailsView1.FindControl("Image2") as Image;
            if (fileUpload != null && image != null)
            {
                if (fileUpload.HasFile)
                {
                    fileUpload.SaveAs(Server.MapPath(@"~\Images\") + fileUpload.FileName);
                    image.ImageUrl = @"~\Images\" + fileUpload.FileName;
                }
            }
        }
        // upload image with GridView
        public static void LoadHinh(GridView GridView1, string strFileUpload, string strImage, HttpServerUtility Server)
        {

        }
    }
}